import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { LaborCostTotalVO, LaborCostTotalForm, LaborCostTotalQuery } from '@/api/business/laborCostTotal/types';

/**
 * 查询劳务列表
 * @param query
 * @returns {*}
 */

export const listLaborCostTotal = (query?: LaborCostTotalQuery): AxiosPromise<LaborCostTotalVO[]> => {
  return request({
    url: '/business/laborCostTotal/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询劳务详细
 * @param laborCostTotalId
 */
export const getLaborCostTotal = (laborCostTotalId: string | number): AxiosPromise<LaborCostTotalVO> => {
  return request({
    url: '/business/laborCostTotal/' + laborCostTotalId,
    method: 'get'
  });
};

/**
 * 新增劳务
 * @param data
 */
export const addLaborCostTotal = (data: LaborCostTotalForm) => {
  return request({
    url: '/business/laborCostTotal',
    method: 'post',
    data: data
  });
};

/**
 * 修改劳务
 * @param data
 */
export const updateLaborCostTotal = (data: LaborCostTotalForm) => {
  return request({
    url: '/business/laborCostTotal',
    method: 'put',
    data: data
  });
};

/**
 * 删除劳务
 * @param laborCostTotalId
 */
export const delLaborCostTotal = (laborCostTotalId: string | number | Array<string | number>) => {
  return request({
    url: '/business/laborCostTotal/' + laborCostTotalId,
    method: 'delete'
  });
};
